package com.changanw.zipkin2;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class HelloController {
    @Autowired
    RestTemplate restTemplate;
    public final static Logger logger = LoggerFactory.getLogger(HelloController.class);
    @GetMapping("/hello")
    public void hello() throws InterruptedException {
        logger.info("hello");
        String s =  restTemplate.getForObject("http://localhost:8080/hello?name={1}",
                String.class,"changanw");
        logger.info(s);
    }
}
